<template>
	<view>
		<nav-bar :isBack="true" title="组件" background="#fff"></nav-bar>
		<view class="func-list">
			<view class="func" v-for="(item,index) in funcList" :key="index + item" @click="func(index)">{{item}}</view>
			<view class="func top" @click="toTop">回到顶部</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				funcList: ['view','image','scroll-view','video']
			}
		},
		methods: {
			toTop() {
				uni.pageScrollTo({
				    scrollTop: 0,
				    duration: 300
				});
			}
		}
	}
</script>

<style>
.func-list {
		width: 100%;
		display: flex;
		flex-direction: column;
	}
	.func {
		width: 100%;
		height: 80rpx;
		margin-bottom: 20rpx;
		background-color: #eee;
		text-align: center;
		line-height: 80rpx;
	}
	.top {
		background-color: #2589FF;
		color: #FFFFFF;
	}
</style>
